﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _020_021_022事件详解_4窗体中体验
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.button3.Click += this.ButtonClicked;
            this.button3.Click += new EventHandler(this.ButtonClicked);
            this.button3.Click += delegate (object sender, EventArgs e)
            {
                this.textBox1.Text = "666";
            };
        }

        private void ButtonClicked(object sender, EventArgs e)
        {
          
            if (sender == this.button1) {
                this.textBox1.Text = "Hello World";
            }
            if (sender == this.button2)
            {
                this.textBox1.Text = "你好 世界";
            }
            if (sender == this.button3) {
                this.textBox1.Text = "OK";
            }

        }
    }
}
